package org.slusk.thynwor.onlinereinforcement;

import com.anji.hyperneat.nd.NDFloatArray;
import com.anji.hyperneat.onlinereinforcement.ActivatorNDBackPropagator;
import com.anji.hyperneat.onlinereinforcement.ActivatorNDLR;

/**
 * This class is just to provide additional backprop training for comparison 
 * against the rotational bp trainer
 * @author slusk
 *
 */
public class ActivatorNDMultiBackProp extends ActivatorNDBackPropagator {

	public ActivatorNDMultiBackProp(ActivatorNDLR phenotype) {
		super(phenotype);
	}
	
	@Override
	public void updateNet(NDFloatArray desiredOuts) {
		updateNet(desiredOuts, 1.0f);
	}

	@Override
	public void updateNet(NDFloatArray desiredOuts, float learningRateModifier) {
		NDFloatArray ins = this.getInputs();
		for (int i = 0; i < 4; i++) {// not going to bother making this a config right now
			this.next(ins);
			this.performBackPropagation(desiredOuts, learningRateModifier);
		}
	}

}
